
const Result = require('../utils/Result');

exports.requireLogin = function(req, res, next) {
    let token = req.headers.token;
    if (!token) {
        return Result.errorCode(res, 401, "无效token,请重新登录");
    }
    
    next();
};